# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CertificateManager.V1.Model.ManagedCertificate do
  @moduledoc """
  Configuration and state of a Managed Certificate. Certificate Manager provisions and renews Managed Certificates automatically, for as long as it's authorized to do so.

  ## Attributes

  *   `authorizationAttemptInfo` (*type:* `list(GoogleApi.CertificateManager.V1.Model.AuthorizationAttemptInfo.t)`, *default:* `nil`) - Output only. Detailed state of the latest authorization attempt for each domain specified for managed certificate resource.
  *   `dnsAuthorizations` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Immutable. Authorizations that will be used for performing domain authorization.
  *   `domains` (*type:* `list(String.t)`, *default:* `nil`) - Optional. Immutable. The domains for which a managed SSL certificate will be generated. Wildcard domains are only supported with DNS challenge resolution.
  *   `issuanceConfig` (*type:* `String.t`, *default:* `nil`) - Optional. Immutable. The resource name for a CertificateIssuanceConfig used to configure private PKI certificates in the format `projects/*/locations/*/certificateIssuanceConfigs/*`. If this field is not set, the certificates will instead be publicly signed as documented at https://cloud.google.com/load-balancing/docs/ssl-certificates/google-managed-certs#caa.
  *   `provisioningIssue` (*type:* `GoogleApi.CertificateManager.V1.Model.ProvisioningIssue.t`, *default:* `nil`) - Output only. Information about issues with provisioning a Managed Certificate.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the managed certificate resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :authorizationAttemptInfo =>
            list(GoogleApi.CertificateManager.V1.Model.AuthorizationAttemptInfo.t()) | nil,
          :dnsAuthorizations => list(String.t()) | nil,
          :domains => list(String.t()) | nil,
          :issuanceConfig => String.t() | nil,
          :provisioningIssue => GoogleApi.CertificateManager.V1.Model.ProvisioningIssue.t() | nil,
          :state => String.t() | nil
        }

  field(:authorizationAttemptInfo,
    as: GoogleApi.CertificateManager.V1.Model.AuthorizationAttemptInfo,
    type: :list
  )

  field(:dnsAuthorizations, type: :list)
  field(:domains, type: :list)
  field(:issuanceConfig)
  field(:provisioningIssue, as: GoogleApi.CertificateManager.V1.Model.ProvisioningIssue)
  field(:state)
end

defimpl Poison.Decoder, for: GoogleApi.CertificateManager.V1.Model.ManagedCertificate do
  def decode(value, options) do
    GoogleApi.CertificateManager.V1.Model.ManagedCertificate.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CertificateManager.V1.Model.ManagedCertificate do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
